<template>

	<view class="container">
		<uni-collapse accordion>
			<uni-collapse-item title="手风琴效果" v-for="(item,index) in recordingData"
				>
				<template v-slot:title>
					<uni-card :title="'批次号:'+item.pch" :sub-title="'后送方式:'+item.fs" :extra="'状态:'+item.zt" :thumbnail="avatar" @click="onClick">
						<text class="uni-body">
							后送类型：{{item.lx}}
							\n处理时间：{{item.gxztsj}}
							\n送往：{{item.sw}}
							\n说明：{{item.bz}}
						</text>
					</uni-card>
				</template>
				<view class="" style="margin: 0 30rpx;">
					<view class="title" style="background-color: #EEE;display: flex;align-items: center;justify-content:space-around;margin-bottom: 16rpx;">
						<text>患者</text>
						<text>后送时间</text>
						<text>体位</text>
						<text>担架</text>
						<text>后送状态</text>
					</view>
					<view class="cont"  v-for="(item1,index) in item.hs" style="background-color: #FFF;display: flex;align-items: center;justify-content:space-around;margin-bottom: 16rpx;">
						<text>{{item1.xm}}</text>
						<text>{{item1.sj}}</text>
						<text>{{item1.tw}}</text>
						<text>{{item1.dj}}</text>
						<text>{{item1.zt}}</text>
					</view>
				</view>
			</uni-collapse-item>
		
		</uni-collapse>
		<uni-load-more :status="status" :contentText="contentText" />
	</view>
</template>
<script>
	import { inquireRecording } from '../../api/huanzhe.js'
	import { useRouter } from '../../utils/utils.js'
	export default {
		data() {
			return {
				recordingData:[],
				status: 'more',
				contentText: {
					contentdown: '上拉加载更多',
					contentrefresh: '加载中',
					contentnomore: '我也是有底线的~'
				},
				InquireData:{
					pageNum:1,
					pageSize: 20
				},
				
			}
		},
		onLoad(){
			this.inquireQuery()
		},
		onReachBottom(e){
			this.status = 'loading'
			this.InquireData.pageNum++;
			this.inquireQuery()
		},
		onPullDownRefresh() {
			this.InquireData.pageNum = 1;
			this.inquireQuery()
		},
		methods: {
			// 后送记录查询
			inquireQuery(){
				inquireRecording(this.InquireData).then(res=>{
					
				if (!res.rows.length) {
					this.status = 'no-more'
				} else {
					this.status = 'more'
				}
				if (this.recordingData.length) {
					this.recordingData.push(...res.rows)
				} else {
					console.log(res.rows);
					this.recordingData = res.rows
				}
				})
			},
			nursingDetail(item){
				console.log(item);
				useRouter('/pages/evacuationRecording/detailRecording',{
					pc:item.pch,
					lx:item.lx,
					fs:item.fs,
					gxztsj:item.gxztsj,
					sw:item.sw,
					bz:item.bz,
					zt:item.zt,
					xm:item.hs[0].xm,
					sj:item.hs[0].sj,
					tw:item.hs[0].tw,
					dj:item.hs[0].dj,
					hszt:item.hs[0].zt
				},'navigateTo')
			}
		}
	}
</script>
<style lang="scss">
</style>